﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace CJiaBao.Core.Utils
{
    /// <summary>
    /// JSON转换
    /// </summary>
    public class JsonHelper
    {
        public static T ToObject<T>(string json)
        {
           return JsonConvert.DeserializeObject<T>(json);
        }

        public static string ToJson(object model)
        {
            return JsonConvert.SerializeObject(model);
        }
    }
}
